package com.iv.durian.cloud.api.service;

import com.iv.durian.cloud.Notice;
import com.iv.durian.cloud.facade.NoticeFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeService {

    @Autowired
    private NoticeFacade noticeFacade;

    public void addNotice(Notice notice){
        noticeFacade.add(notice);
    }

    public Notice getNoticeById(Integer noticeId){
        return noticeFacade.get(noticeId);
    }

    public List<Notice> getList(Integer lessionId, Integer offset, Integer limit){
        return noticeFacade.list(lessionId, offset, limit);
    }

    public int count(Notice notice){
        return noticeFacade.count(notice);
    }

    public int removeNoticeById(Integer id){
        return noticeFacade.remove(id);
    }

    public void updateNotice(Notice notice){
        noticeFacade.update(notice);
    }

}
